package sojo.com.inverter.enums;


/**
 * @author cheng_hu
 * @description: 告警1
 * @date 2023-02-25 14:04:43
 */
public enum AlarmEnum_3 {
    Alarm_0(0, 2081, "优化器故障[5]", "提示"),
    Alarm_1(1, 2085, "内置PID工作异常[6]", "次要"),
    Alarm_2(2, 2014, "输入组串对地电压高", "重要"),
    Alarm_3(3, 2086, "外部风扇异常", "重要"),
    Alarm_4(4, 2069, "储能反接[7]", "重要"),
    Alarm_5(5, 2082, "并离网控制器异常[4]", "重要"),
    Alarm_6(6, 2015, "组串丢失", "提示"),
    Alarm_7(7, 2087, "内部风扇异常", "重要"),
    Alarm_8(8, 2088, "直流保护单元异常[8]", "重要"),
    Alarm_9(9, 2089, "EL单元异常", "次要"),
    Alarm_10(10, 2090, "有功调度指令异常", "重要"),
    Alarm_11(11, 2091, "无功调度指令异常", "重要"),
    Alarm_12(12, 2092, "CT接线异常", "重要"),
    Alarm_13(13, 2003, "直流电弧故障", "重要"),
    Alarm_14(14, 2093, "直流开关异常", "次要"),
    Alarm_15(15, 2094, "储能允许放电容量低", "提示");


    private int bit; //bit值
    private int alarmId; //告警ID
    private String alarmName; //告警名称
    private String alarmLevel; //告警级别
    AlarmEnum_3(int bit, int alarmId, String alarmName, String alarmLevel) {
        this.bit = bit;
        this.alarmId = alarmId;
        this.alarmName = alarmName;
        this.alarmLevel = alarmLevel;
    }

    public static String getAlarmName(int bit) {
        for (AlarmEnum_3 alarmEnum : AlarmEnum_3.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmName();
            }
        }
        return "";
    }

    public static int getAlarmId(int bit) {
        for (AlarmEnum_3 alarmEnum : AlarmEnum_3.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmId();
            }
        }
        return -1;
    }

    public static String getAlarmLevel(int bit) {
        for (AlarmEnum_3 alarmEnum : AlarmEnum_3.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmLevel();
            }
        }
        return "";
    }

    public String getAlarmLevel() {
        return alarmLevel;
    }

    public void setAlarmLevel(String alarmLevel) {
        this.alarmLevel = alarmLevel;
    }

    public int getBit() {
        return bit;
    }

    public void setBit(int bit) {
        this.bit = bit;
    }

    public int getAlarmId() {
        return alarmId;
    }

    public void setAlarmId(int alarmId) {
        this.alarmId = alarmId;
    }

    public String getAlarmName() {
        return alarmName;
    }

    public void setAlarmName(String alarmName) {
        this.alarmName = alarmName;
    }
}
